package com.vq3.digitalizationsoftwareintegrates;


import com.vq3.digitalizationsoftwareintegrates.Servlet.WebSocket.WebSocketServer;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;


/**这个和多源数据库有关
 * */
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
@MapperScan("com.vq3.digitalizationsoftwareintegrates.Mapper")
@EnableScheduling//开启定时任务

public class DigitalizationSoftwareIntegratesApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(DigitalizationSoftwareIntegratesApplication.class, args);
        WebSocketServer.setApplicationContext(applicationContext);
        }
        /**websocket服务随系统启动而启动
         * */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    }




